home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / cujaug93.zip / 1108113B < prev    next >
Text File  |  1993-06-09  |  316b  |  25 lines

  1. /* swap1.c: A *BOGUS* swap function */
  2. #include <stdio.h>
  3.  
  4. void swap(int, int);
  5.  
  6. main()
  7. {
  8.     int i = 7, j = 8;
  9.     
  10.     swap(i,j);
  11.     printf("i == %d, j == %d\n",i,j);
  12.     return 0;
  13. }
  14.  
  15. void swap(int x, int y)
  16. {
  17.     int temp = x;
  18.     x = y;
  19.     y = temp;
  20. }
  21.  
  22. /* OUTPUT:
  23.  * i == 7, j == 8 */
  24.  
  25.